FROM registry-vpc.cn-shanghai.aliyuncs.com/mom2_base/nginx:1.17.5

ENV RUN_GROUP nginx
ENV DATA_DIR /home/www/dist
# 指定项目根目录下的nginx的配置覆盖默认配置
RUN rm /etc/nginx/conf.d/default.conf

ADD nginx.conf /etc/nginx/nginx.conf
ADD nginx.conf /etc/nginx/conf.d/default.conf
# ADD proxy.conf /etc/nginx/conf.d/proxy.conf
# 复制源码到容器的/home目录
COPY . /home/www

# 指定执行的工作目录
WORKDIR /home/www

# 以实际nginx配置为主
EXPOSE 80

RUN mkdir /root/app-logs && ln -s /var/log/nginx/access.log /root/app-logs/tasks-manage-web-app.log

# CMD 运行以下命令
CMD ["nginx", "-g", "daemon off;"]
